# -*- coding: utf-8 -*-            
# @Author : liguang
# @Time : 2023/11/17 16:26

my_dict = {'王力宏': 22, "李广": 43, "林俊杰": 123}
print(f"打印字典中的值：{my_dict},打印字典的类型：{type(my_dict)}")

# 两种定义字典的方式
my_dict1 = {}
my_dict2 = dict()
print(f"打印我的第一个字典：{my_dict1}")
print(f"打印我的第二个字典：{my_dict2}")

print("+++++++++++++++++++++++++++++++++++++++++++++++")
my_dict = {'王力宏': 22, "李广": 43, "林俊杰": 123,"李广":2222}
print(f"打印字典中的值：{my_dict},打印字典的类型：{type(my_dict)}")
print("================================")
score = my_dict["李广"]
print(f"打印得到这里的值：{score}")

print("================")
dict_keys = my_dict.keys()
print(f"获取得到所有的key:{dict_keys}")

for ele in dict_keys:
    value = my_dict[ele]
    print(f"获取得到字典中的value:{value}")

print("===========================")
for key in my_dict:
    print(f"获取得到的key是：{key},对应的值是：{my_dict[key]}")
